{% extends 'finance_base.html' %}

{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript" src="{% url finance_static "js/jquery.tablesorter.min.js" %}"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#invoice_table").tablesorter();
    $("table.list tr:even").addClass("even");
});
</script>
{% endblock%}

{% load humanize %}
{% block content %}
<h3>{{ year }} Transaction</h3>
<div id="navi">
    <ul>
        <li><a href="{% url transaction_create %}">transaction create</a></li>
    </ul>
</div>

<h3>Summary</h3>
<table class="tablesorter list">
<thead>
    <tr>
        <th>-</th>
        <th><a href="{% url transaction_month_list 2011 1 %}">Jan</a></th>
        <th><a href="{% url transaction_month_list 2011 2 %}">Feb</a></th>
        <th><a href="{% url transaction_month_list 2011 3 %}">Mar</a></th>
        <th><a href="{% url transaction_month_list 2011 4 %}">Apr</a></th>
        <th><a href="{% url transaction_month_list 2011 5 %}">May</a></th>
        <th><a href="{% url transaction_month_list 2011 6 %}">Jun</a></th>
        <th><a href="{% url transaction_month_list 2011 7 %}">Jul</a></th>
        <th><a href="{% url transaction_month_list 2011 8 %}">Aug</a></th>
        <th><a href="{% url transaction_month_list 2011 9 %}">Sep</a></th>
        <th><a href="{% url transaction_month_list 2011 10 %}">Oct</a></th>
        <th><a href="{% url transaction_month_list 2011 11 %}">Nov</a></th>
        <th><a href="{% url transaction_month_list 2011 12 %}">Dec</a></th>
    </tr>
</thead>
<tbody>
    <tr>
        <td><b>총입금액</b></td>
        {% for m in year_m.values %}
        <td>
            {% if m %}
                {{ m.deposit|intcomma }}
            {% else %}
                0
            {% endif %}
        </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>총출금액</b></td>
        {% for m in year_m.values %}
        <td>
            {% if m %}
                {{ m.expense|intcomma }}
            {% else %}
                0
            {% endif %}
        </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>잔액</b></td>
        {% for m in year_m.values %}
        <td>
            {% if m %}
                {{ m.balance|intcomma }}
            {% else %}
                0
            {% endif %}
        </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>호주총출금액</b></td>
        {% for m in year_m.values %}
        <td>
            {% if m %}
                {{ m.a_expense|intcomma }}
            {% else %}
                0
            {% endif %}
        </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>한국총출금액</b></td>
        {% for m in year_m.values %}
        <td>
            {% if m %}
                {{ m.k_expense|intcomma }}
            {% else %}
                0
            {% endif %}
        </td>
        {% endfor %}
    </tr>
</tbody>
</table>

{% endblock %}